#ifndef _BOOK_HEADER
#define _BOOK_HEADER
#include <string>
#include "Item.h"

#define DEFAULT_BOOK_COUNT		20

class Book : public Item{
	static size_t _count;
	std::string _name;
	std::string _isbn;
	std::string _author;
	// std::time _publicationTime;
public:
	Book(std::string name, std::string isbn, std::string author = "Ra") : _name(name), _isbn(isbn), _author(author){}
	Book(const Book& book) : _name(book._name), _isbn(book._isbn), _author(book._author){}
	~Book();

	const std::string getName() const{
		return _name;
	}
	// Error C2678: binary '=' : no operator found which takes a left-hand operand of type 'const std::string' (or there is no acceptable conversion)
	// void setName(const std::string& name) const{
	void setName(const std::string& name){
		_name = name;
	}

	static void revert(){
		++ _count;
	}
	static void borrow(){		
		--_count;
	}
	void info() const;
};

size_t Book::_count = DEFAULT_BOOK_COUNT; // Initialization of static member

Book::~Book(){
	std::cout << "Release Book, Id: " << getId() << ", Name: " << _name << std::endl;
}

void Book::info() const{
	std::cout << "Book Id: " << getId() << ", ISBN: " << _isbn << ", Name: " << _name << ", Author: " << _author << std::endl;
}
#endif // _BOOK_HEADER
